package com.santu.edu.supporter.biz.team.pojo.enums;

import com.santu.edu.supporter.exception.BizException;
import com.santu.edu.supporter.exception.CustomError;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author luoyaoqi
 * @createTime 2024/3/7
 * @description
 */
@AllArgsConstructor
@Getter
public enum TeamTypeEnum {

    /**
     *
     */

    KD(0,"快递"),;


    private final Integer code;

    private final String desc;

    public static TeamTypeEnum convert(Integer code) {
        for (TeamTypeEnum item : TeamTypeEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        throw BizException.causeBy(CustomError.ENUM_CONVERT_ERROR,"TeamTypeEnum转换异常");
    }
}
